/**
 * @properties={typeid:35,uuid:"7A37CF0F-274F-4BD5-9F68-A5C5AD14A1C7"}
 */
var fUserv = null;

/**
 * @properties={typeid:35,uuid:"B91D1C64-5916-4195-A1F2-DB375FC97A75"}
 */
var fPass = null;

/**
 * @properties={typeid:35,uuid:"E0A64412-DADD-462A-A943-4D0C3B57AB92",variableType:4}
 */
var entro = 0;

/**
 *
 * @properties={typeid:24,uuid:"A267A3F9-B685-4DEF-B957-AAEB384A3ACA"}
 */
function Conectar()
{
	currentcontroller.showAllRecords()
	currentcontroller.find()
	login_nombre = fUserv
	var found = currentcontroller.search()
	
	if (found == 1)
		if (hash_password == utils.stringMD5HashBase64(fPass))
		{
			entro = 1
			application.closeForm('LOGIN')
			globals.gUservID = userv_id
			databaseManager.addTableFilterParam('fwk_navigation_infocom',null,'userv_id','=',userv_id,'USERVID')
			fPass = null
			application.showForm('main')
		}
		else
			globals.gDialog('Error','Contraseña Invalida','OK','CerrarForm')
	else
		globals.gDialog('Error','Usuario Invalido','OK','CerrarForm')
}

/**
 * Handle hide window.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @returns {Boolean}
 *
 * @properties={typeid:24,uuid:"CF9385BE-9F11-46E1-99D7-8E7A657CE504"}
 */
function onHide(event) {
	if (entro == 0)
		return false
	return true
}
